package com.lc.demo;

import com.lc.annotation.Param;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

public class User {
    private int id;
    private String name;

    public User() {
    }

    public User(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static void main(String[] args) throws NoSuchMethodException {
        Method selectUser = UserDAO.class.getMethod("selectUser", String.class);
        Parameter[] parameters = selectUser.getParameters();
        for (Parameter parameter : parameters) { //
            Param annotation = parameter.getAnnotation(Param.class);
            System.out.println(annotation.value());
        }
    }
}
